<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>组件 | Vue.js</title>
    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    
</head>

<body>
    
    <div id="app-8">
        <center>
            <h2>Vue.js 使用</h2>
            <h2>TestMessage : {{ a }}</h2>
            <input type="text" v-model="a" />
        </center>
    </div>

    <script>
        // 定义数据对象
        var data = {a:1}
        //Object.freeze需要在锁定的对象后进行调用，不能在实例化后调用
        Object.freeze(data)
        //
        var app8 = new Vue({
            el: "#app-8",
            data : data
        })
        
        console.log(app8.a == data.a)
    </script>
    
</body>

</html>